home *** CD-ROM | disk | FTP | other *** search
/ Hackers Underworld 2: Forbidden Knowledge / Hackers Underworld 2: Forbidden Knowledge.iso / HACKING / HACKPASS.SHR < prev    next >
Text File  |  1994-07-17  |  36KB  |  1,600 lines

  1. #! /bin/sh
  2. # This is a shell archive.  Remove anything before this line, then unpack
  3. # it by saving it into a file and typing "sh file".  To overwrite existing
  4. # files, type "sh file -c".  You can also feed this as standard input via
  5. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  6. # will see the following message at the end:
  7. #        "End of archive 1 (of 1)."
  8. # Contents:  CRACK CRACK/Crack CRACK/DICTS CRACK/Makefile CRACK/PROGS
  9. #   CRACK/PROGS/-i CRACK/PROGS/Makefile CRACK/PROGS/crack-lib.c
  10. #   CRACK/PROGS/crack-pp.c CRACK/PROGS/crack-pwc.c CRACK/PROGS/crack.h
  11. #   CRACK/PROGS/sh.makedict CRACK/README CRACK/bad_pws.dat
  12. # Wrapped by aem@aberda on Mon Jul 15 19:08:05 1991
  13. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  14. if test ! -d 'CRACK' ; then
  15.     echo shar: Creating directory \"'CRACK'\"
  16.     mkdir 'CRACK'
  17. fi
  18. if test -f 'CRACK/Crack' -a "${1}" != "-c" ; then
  19.   echo shar: Will not clobber existing file \"'CRACK/Crack'\"
  20. else
  21. echo shar: Extracting \"'CRACK/Crack'\" \(492 characters\)
  22. sed "s/^X//" >'CRACK/Crack' <<'END_OF_FILE'
  23. X#!/bin/csh
  24. X
  25. Xset op=hack-me.$$
  26. Xset tmp=/tmp/pwf$$
  27. Xset bin=PROGS
  28. Xset dicts=DICTS
  29. X
  30. Xif ( "$1" == "" ) then
  31. X    echo "Usage:    $0 passwdfile [passwdfile...]"
  32. X    exit 1
  33. Xendif
  34. X
  35. Xecho "Crack 2.7a Password Cracker by ADE Muffett, 1991"
  36. X
  37. Xmake
  38. X
  39. Xcp /dev/null $tmp    # "touch $tmp", "> $tmp", whatever...
  40. X
  41. Xforeach file ($*)
  42. X    awk '/^[A-Za-z0-9]/{print "'$file'" ":" $0}' < $file >> $tmp
  43. Xend
  44. X
  45. Xecho "Backgrounding job. Output will be in $op"
  46. X
  47. Xsort -t: +2 $tmp | $bin/crack-pwc $dicts/dict.* >& $op &
  48. X
  49. Xsleep 5
  50. X
  51. Xrm $tmp
  52. END_OF_FILE
  53. if test 492 -ne `wc -c <'CRACK/Crack'`; then
  54.     echo shar: \"'CRACK/Crack'\" unpacked with wrong size!
  55. fi
  56. chmod +x 'CRACK/Crack'
  57. # end of 'CRACK/Crack'
  58. fi
  59. if test ! -d 'CRACK/DICTS' ; then
  60.     echo shar: Creating directory \"'CRACK/DICTS'\"
  61.     mkdir 'CRACK/DICTS'
  62. fi
  63. if test -f 'CRACK/Makefile' -a "${1}" != "-c" ; then
  64.   echo shar: Will not clobber existing file \"'CRACK/Makefile'\"
  65. else
  66. echo shar: Extracting \"'CRACK/Makefile'\" \(725 characters\)
  67. sed "s/^X//" >'CRACK/Makefile' <<'END_OF_FILE'
  68. X###
  69. X# add other dictionaries here, relative to "."
  70. X###
  71. XDICTSRC=    /usr/dict/words bad_pws.dat
  72. X
  73. X###
  74. X# Not-so configurable bitz...
  75. X###
  76. XBINDIR=        PROGS
  77. XDICTDIR=    DICTS
  78. XPPDRIVER=    $(BINDIR)/sh.makedict
  79. XDICTSTAMP=    $(DICTDIR)/dict-stamp
  80. X
  81. Xall:        # I love recursion...
  82. X        ( cd $(BINDIR) ; make )
  83. X        ( make $(DICTSTAMP) )
  84. X
  85. X$(DICTSTAMP):    $(PP) $(DICTSRC)
  86. X        $(PPDRIVER) $(DICTDIR) $(DICTSRC)
  87. X        touch $(DICTSTAMP)
  88. X
  89. Xtests:
  90. X        ( cd $(BINDIR) ; make tests )
  91. X
  92. Xalotfaster:
  93. X        ( cd $(BINDIR) ; make alotfaster )
  94. X
  95. Xclean:
  96. X        -( cd $(DICTDIR) && rm * )
  97. X        -rm die hack-me.* dict.?
  98. X
  99. Xspotless:
  100. X        ( cd $(BINDIR) && make clean )
  101. X        ( make clean )
  102. X
  103. Xprint:
  104. X        lpr -p     Makefile \
  105. X            Crack \
  106. X            README \
  107. X            PROGS/Makefile \
  108. X            PROGS/*.h \
  109. X            PROGS/*.c \
  110. X            PROGS/sh.*
  111. END_OF_FILE
  112. if test 725 -ne `wc -c <'CRACK/Makefile'`; then
  113.     echo shar: \"'CRACK/Makefile'\" unpacked with wrong size!
  114. fi
  115. # end of 'CRACK/Makefile'
  116. fi
  117. if test ! -d 'CRACK/PROGS' ; then
  118.     echo shar: Creating directory \"'CRACK/PROGS'\"
  119.     mkdir 'CRACK/PROGS'
  120. fi
  121. if test -f 'CRACK/PROGS/-i' -a "${1}" != "-c" ; then
  122.   echo shar: Will not clobber existing file \"'CRACK/PROGS/-i'\"
  123. else
  124. echo shar: Extracting \"'CRACK/PROGS/-i'\" \(0 characters\)
  125. sed "s/^X//" >'CRACK/PROGS/-i' <<'END_OF_FILE'
  126. END_OF_FILE
  127. if test 0 -ne `wc -c <'CRACK/PROGS/-i'`; then
  128.     echo shar: \"'CRACK/PROGS/-i'\" unpacked with wrong size!
  129. fi
  130. # end of 'CRACK/PROGS/-i'
  131. fi
  132. if test -f 'CRACK/PROGS/Makefile' -a "${1}" != "-c" ; then
  133.   echo shar: Will not clobber existing file \"'CRACK/PROGS/Makefile'\"
  134. else
  135. echo shar: Extracting \"'CRACK/PROGS/Makefile'\" \(513 characters\)
  136. sed "s/^X//" >'CRACK/PROGS/Makefile' <<'END_OF_FILE'
  137. X###
  138. X# Configurtable bitz...
  139. X###
  140. XCFLAGS=        -O2 # -Bstatic # (Static linking for SunOS fix)
  141. X
  142. X###
  143. X# Not-so configurable bitz...
  144. X###
  145. XPWC=        crack-pwc
  146. XPP=        crack-pp
  147. X
  148. X###
  149. X# Positively hard to configure bitz...
  150. X###
  151. XCRACKMOD=    crack-lib.o
  152. X
  153. Xall:        $(PP) $(PWC)
  154. X
  155. X$(PP):    $(PP).o $(CRACKMOD)
  156. X        $(CC) $(CFLAGS) -o $@ crack-pp.o $(CRACKMOD)
  157. X
  158. X$(PWC):    $(PWC).o $(CRACKMOD)
  159. X        $(CC) $(CFLAGS) -o $@ crack-pwc.o $(CRACKMOD)
  160. X
  161. Xalotfaster:
  162. X        $(CC) -O4 -o $(PWC) \
  163. X            crack-pwc.c crack-lib.c
  164. X
  165. Xclean:
  166. X        -rm $(PP) $(PWC) *.o *.u $(DICTSTAMP)
  167. END_OF_FILE
  168. if test 513 -ne `wc -c <'CRACK/PROGS/Makefile'`; then
  169.     echo shar: \"'CRACK/PROGS/Makefile'\" unpacked with wrong size!
  170. fi
  171. # end of 'CRACK/PROGS/Makefile'
  172. fi
  173. if test -f 'CRACK/PROGS/crack-lib.c' -a "${1}" != "-c" ; then
  174.   echo shar: Will not clobber existing file \"'CRACK/PROGS/crack-lib.c'\"
  175. else
  176. echo shar: Extracting \"'CRACK/PROGS/crack-lib.c'\" \(1764 characters\)
  177. sed "s/^X//" >'CRACK/PROGS/crack-lib.c' <<'END_OF_FILE'
  178. X#include "crack.h"
  179. X
  180. X/*
  181. X * This program is copyright (c) Alec Muffett 1991 except for certain
  182. X * portions of code ("fdes-crypt.c") copyright (c) Robert Baldwin, Icarus
  183. X * Sparry and Alec Muffett.  The author(s) disclaims all responsibility or
  184. X * liability with respect to it's usage or its effect upon hardware or
  185. X * computer systems.  This software is in the public domain and is freely
  186. X * redisrtibutable PROVIDED that this copyright notice remains intact.
  187. X */
  188. X
  189. Xvoid
  190. XTrim (string)            /* remove trailing whitespace from a string */
  191. X    register char *string;
  192. X{
  193. X    register char *ptr;
  194. X
  195. X    for (ptr = string; *ptr; ptr++);
  196. X    while ((--ptr >= string) && isspace (*ptr));
  197. X    *(++ptr) = '\0';
  198. X}
  199. X
  200. Xchar *
  201. XReverse (str)            /* return a pointer to a reversal */
  202. X    register char *str;
  203. X{
  204. X    register int i;
  205. X    register int j;
  206. X    register char *ptr;
  207. X    static char area[STRINGSIZE];
  208. X
  209. X    j = i = strlen (str);
  210. X    while (*str)
  211. X    {
  212. X    area[--i] = *str++;
  213. X    }
  214. X    area[j] = '\0';
  215. X    return (area);
  216. X}
  217. X
  218. Xchar *
  219. XUppercase (str)            /* return a pointer to an uppercase */
  220. X    register char *str;
  221. X{
  222. X    register char *ptr;
  223. X    static char area[STRINGSIZE];
  224. X
  225. X    ptr = area;
  226. X    while (*str)
  227. X    {
  228. X    *(ptr++) = islower (*str) ? toupper (*str) : *str;
  229. X    str++;
  230. X    }
  231. X    *ptr = '\0';
  232. X
  233. X    return (area);
  234. X}
  235. X
  236. Xchar *
  237. XLowercase (str)            /* return a pointer to an lowercase */
  238. X    register char *str;
  239. X{
  240. X    register char *ptr;
  241. X    static char area[STRINGSIZE];
  242. X
  243. X    ptr = area;
  244. X    while (*str)
  245. X    {
  246. X    *(ptr++) = isupper (*str) ? tolower (*str) : *str;
  247. X    str++;
  248. X    }
  249. X    *ptr = '\0';
  250. X
  251. X    return (area);
  252. X}
  253. X
  254. Xchar *
  255. XClone (string)
  256. X    char *string;
  257. X{
  258. X    int len;
  259. X    char *retval;
  260. X
  261. X    retval = (char *) malloc (strlen (string) + 1);
  262. X    strcpy (retval, string);
  263. X    return (retval);
  264. X}
  265. END_OF_FILE
  266. if test 1764 -ne `wc -c <'CRACK/PROGS/crack-lib.c'`; then
  267.     echo shar: \"'CRACK/PROGS/crack-lib.c'\" unpacked with wrong size!
  268. fi
  269. # end of 'CRACK/PROGS/crack-lib.c'
  270. fi
  271. if test -f 'CRACK/PROGS/crack-pp.c' -a "${1}" != "-c" ; then
  272.   echo shar: Will not clobber existing file \"'CRACK/PROGS/crack-pp.c'\"
  273. else
  274. echo shar: Extracting \"'CRACK/PROGS/crack-pp.c'\" \(3019 characters\)
  275. sed "s/^X//" >'CRACK/PROGS/crack-pp.c' <<'END_OF_FILE'
  276. X#include "crack.h"
  277. X
  278. X/*
  279. X * This program is copyright (c) Alec Muffett 1991 except for certain
  280. X * portions of code ("fdes-crypt.c") copyright (c) Robert Baldwin, Icarus
  281. X * Sparry and Alec Muffett.  The author(s) disclaims all responsibility or
  282. X * liability with respect to it's usage or its effect upon hardware or
  283. X * computer systems.  This software is in the public domain and is freely
  284. X * redisrtibutable PROVIDED that this copyright notice remains intact.
  285. X */
  286. X
  287. X/* These used to be enums. Oh well... non-portability rules OK */
  288. X#define ORDER_LCF    0
  289. X#define ORDER_LCFP    1
  290. X#define ORDER_MCF    2
  291. X#define ORDER_UCF    3
  292. X#define ORDER_LCB    4
  293. X#define ORDER_UCB    5
  294. X#define ORDER_MCB    6
  295. X#define NUMFILES    7
  296. X
  297. Xint
  298. Xmain (argc, argv)
  299. X    int argc;
  300. X    char *argv[];
  301. X{
  302. X    register int i;
  303. X    register char *ptr;
  304. X    int all_digits;
  305. X